﻿

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;

namespace HBase {
    public interface IBaseServer {
        Page<T> queryPage<T>(string key,string sql ,string orderBy ,PageDto param = null);//分页查询
        T getById<T>(string key, long id ,IDbTransaction transaction = null) where T : class;//根据id查询
        T getById<T>(string key, String tableName, long id, IDbTransaction transaction = null) where T : class;//根据id查询
        List<T> GetAll<T>(string key, string whereStr = null ,object param = null) where T : class;
        List<T> getAll<T>(string key, string tableName ,string whereStr = null ,object param = null ,string orderField = "") where T : class;
        List<T> GetField<T>(string key, string fields ,string where = null ,object param = null) where T : class;
        long insert(string key, object t) ;
        long insert(string key,String name, object t);
        void insertAll<T>(string key, List<T> t) where T : class;
        long insertNotNull<T>(string key, T t) where T : class;
        void delete<T>(string key, long id) where T : class;
        void delete<T>(string key, string where ,object param) where T : class;
        void executeSql(string key, string sql, object obj);
        void delete(string key, BaseEntity id);
        bool update<T>(string key, T t) where T : class;
        bool update<T>(string key,String tableName, T t) where T : class;
        bool updateNotNull<T>(string key, T t) where T : class;

        void runProcedure(string key, string proc, params SqlParameter[] parameters);
    }
}
